package com.bamanker.authclient.feign;


import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author bamanker
 */
@Component
@Slf4j
public class ResFeignClientFallback implements ResClient {

    @Override
    public Object getRes1(String accessToken) {
        log.error("调用接口 /resource1 失败，参数：{}", accessToken);
//        //return "OpenFeign 降级";
//        throw new BusinessException(ResponseCode.RPC_ERROR.getCode(), ResponseCode.RPC_ERROR.getMsg());
        return new Exception("OpenFeign调用失败");
    }

    @Override
    public Object getRes2(String accessToken) {
        log.error("调用接口 /resource2 失败，参数：{}", accessToken);
        return new Exception("OpenFeign调用失败");
    }

    @Override
    public Object getRes3(String accessToken) {
        log.error("调用接口 /resource3 失败，参数：{}", accessToken);
        return new Exception("OpenFeign调用失败");
    }

    @Override
    public Object getPublicRes(String accessToken) {
        log.error("调用接口 /api/publicResource 失败，参数：{}", accessToken);
        return new Exception("OpenFeign调用失败");
    }
}
